package com.cross.test;

import com.cross.annotation.DataCrossClass;
import com.cross.annotation.DataCrossField;

@DataCrossClass(objectName="person")
public class Person{
	public Person(){
		
	}
	public Person(String name, int age){
		this.name = name;
		this.age = age;
	}
	@DataCrossField(number=1, precision=22, title="姓名", type="String", variable=true)
	private String name;
	
	@DataCrossField(number=2, precision=40, title="年龄", type="int", variable=false)
	private int age;
	@Override
	public boolean equals(Object obj){
		if(obj == null){
			return false;
		}
		if(!(obj instanceof Person)){
			return false;
		}
		Person person =  (Person)obj;
		if(!person.name.equals(name)){
			return false;
		}
		if(person.age != age){
			return false;
		}
		
		return true;
		
	}
	@Override
	public String toString(){
		return "name="+name+", age="+age;
	}
}